Copyright ã1995 by NeXT Computer, Inc.  All Rights Reserved.

NS_DEV_DOCFOR:objc_class:FormCell;,FormCell

Inherits From:	ActionCell : Cell : Object

Declared In:	appkit/FormCell.h

Class Description

This class is used to implement entries in a Form.  It displays a title within itself, and allows editing only in the remaining (right-hand) portion of the Cell.  

See the Form class specification for more on the use of FormCell.  

Instance Variables

NXCoord titleWidth;

id titleCell;

NXCoord titleEndPoint;

titleWidth 	The width of the title portion; if -1, width is calculated as needed.

titleCell 	The Cell used to draw the title.

titleEndPoint 	The coordinate that separates the title from the text area.

Method Types

Initializing, copying, and freeing a FormCell	
- init
- initTextCell: 
- copyFromZone:
- free

Determining a FormCell's size	- calcCellSize:inRect:

Enabling the FormCell	- setEnabled:

Modifying the title	- setTitle:
- title
- setTitleFont:
- titleFont
- setTitleAlignment:
- titleAlignment
- setTitleWidth:
- titleWidth:
- titleWidth

Modifying graphic attributes	- isOpaque

Displaying	- drawInside:inView:
- drawSelf:inView:

Managing cursor rectangles	- resetCursorRect:inView:

Tracking the mouse	- trackMouse:inRect:ofView:

Archiving	- read:
- write:

Instance Methods

NS_DEV_DOCFOR:objc_method:[FormCell-calcCellSize:inRect:];,calcCellSize:inRect:

- calcCellSize:(NXSize *)theSize inRect:(const NXRect *)aRect

Calculates the size of the FormCell assuming it's constrained to fit within aRect.  Returns the size in theSize.

NS_DEV_DOCFOR:objc_method:[FormCell-copyFromZone:];,copyFromZone:

- copyFromZone:(NXZone *)zone

Creates and returns a copy of the receiving FormCell instance allocated from zone.

NS_DEV_DOCFOR:objc_method:[FormCell-drawInside:inView:];,drawInside:inView:

- drawInside:(const NXRect *)cellFrame inView:controlView

Draws only the text inside the FormCell (not the bezel or the title of the FormCell).  If you create a subclass of FormCell and override drawSelf:inView:, you must implement this method as well.  Returns self.

See also:  - drawSelf:inView:

NS_DEV_DOCFOR:objc_method:[FormCell-drawSelf:inView:];,drawSelf:inView:

- drawSelf:(const NXRect *)cellFrame inView:controlView

Has the FormCell's title Cell drawn, then draws the editable text portion of the FormCell.  returns self.

See also:  - drawInside:inView:

NS_DEV_DOCFOR:objc_method:[FormCell-free];,free

- free

Frees the storage used by the FormCell and returns nil.

NS_DEV_DOCFOR:objc_method:[FormCell-init];,init

- init

Initializes and returns the receiver, a new instance of FormCell, with its contents set to an empty string (ªº) and its title set to ªFieldº, right-aligned.

See also:  - initTextCell:

NS_DEV_DOCFOR:objc_method:[FormCell-initTextCell:];,initTextCell:

- initTextCell:(const char *)aString

Initializes and returns the receiver, a new instance of FormCell, with its contents set to the empty string (ªº) and its title set to aString.  The font for both title and text is the user's chosen system font in 12.0 point, and the text area is drawn with a bezel.  This method is the designated initializer for FormCell.

See also:  - init

NS_DEV_DOCFOR:objc_method:[FormCell-isOpaque];,isOpaque

- (BOOL)isOpaque

Returns YES if the FormCell is opaque, NO otherwise.  If the FormCell has a title, then it's not opaque (since the title field is not opaque).

See also:  - isOpaque (Cell)

NS_DEV_DOCFOR:objc_method:[FormCell-read:];,read:

- read:(NXTypedStream *)stream

Reads the FormCell from the typed stream stream.  Returns self.

See also:  - write:

NS_DEV_DOCFOR:objc_method:[FormCell-resetCursorRect:inView:];,resetCursorRect:inView:

- resetCursorRect:(const NXRect *)cellFrame inView:controlView

Adds a cursor rectangle to controlView (with addCursorRect:cursor:), allowing the cursor to change to an I-beam when it passes over the text portion of the FormCell.

See also:  - addCursorRect:cursor: (View, Control)

NS_DEV_DOCFOR:objc_method:[FormCell-setEnabled:];,setEnabled:

- setEnabled:(BOOL)flag

If flag is YES, the FormCell accepts mouse clicks; if NO, it doesn't.

See also:  - isEnabled (Cell)

NS_DEV_DOCFOR:objc_method:[FormCell-setTitle:];,setTitle:

- setTitle:(const char *)aString

Sets the title of the FormCell to aString.

See also:  - title

NS_DEV_DOCFOR:objc_method:[FormCell-setTitleAlignment:];,setTitleAlignment:

- setTitleAlignment:(int)mode

Sets the alignment of the title.  mode can be one of three constants: NX_LEFTALIGNED, NX_CENTERED, or NX_RIGHTALIGNED.

See also:  - titleAlignment

NS_DEV_DOCFOR:objc_method:[FormCell-setTitleFont:];,setTitleFont:

- setTitleFont:fontObject

Sets the Font used to draw the title of the FormCell.

See also:  - setFont:

NS_DEV_DOCFOR:objc_method:[FormCell-setTitleWidth:];,setTitleWidth:

- setTitleWidth:(NXCoord)width

Sets the width of the title field to width.  If width is -1, the title field's width is always calculated when needed.  Use this method only if the FormCell's title isn't going to change, or if your code always resets the title width when it resets the title.

See also:  - titleWidth, - titleWidth:

NS_DEV_DOCFOR:objc_method:[FormCell-title];,title

- (const char *)title

Returns the title of the FormCell.

See also:  - setTitle:

NS_DEV_DOCFOR:objc_method:[FormCell-titleAlignment];,titleAlignment

- (int)titleAlignment

Returns the alignment of the title, which will be one of the following: NX_LEFTALIGNED, NX_CENTERED, or NX_RIGHTALIGNED.

See also:  - setTitleAlignment:

NS_DEV_DOCFOR:objc_method:[FormCell-titleFont];,titleFont

- titleFont

Returns the Font used to draw the title of the FormCell.

See also:  - setTitleFont:

NS_DEV_DOCFOR:objc_method:[FormCell-titleWidth];,titleWidth

- (NXCoord)titleWidth

If the width of the title has already been set, then that value is returned.  Otherwise, it's calculated and returned.

See also:  - setTitleWidth:, - titleWidth:

NS_DEV_DOCFOR:objc_method:[FormCell-titleWidth:];,titleWidth:

- (NXCoord)titleWidth:(const NXSize *)aSize

If the title width has been set, then it's returned.  Otherwise, the width is calculated constrained to aSize.  aSize may be NULL, in which case the width is calculated without constraint.

See also:  - setTitleWidth:, - titleWidth:

NS_DEV_DOCFOR:objc_method:[FormCell-trackMouse:inRect:ofView:];,trackMouse:inRect:ofView:

- (BOOL)trackMouse:(NXEvent*)event 
inRect:(const NXRect*)aRect 
ofView:controlView

Causes editing to occur.  Returns YES if the mouse goes up in the FormCell, NO otherwise.

See also:  - trackMouse:inRect:ofView: (TextFieldCell)

NS_DEV_DOCFOR:objc_method:[FormCell-write:];,write:

- write:(NXTypedStream *)stream

Writes the receiving FormCell to the typed stream stream.  Returns self.

See also:  - read: